package com.java.demo.data;

public class Node {

	private int key;

	private Node leftNode;

	private Node rightNode;

	private String data;

	private Node() {

	}

	private Node(int key, String data) {
		this.key = key;
		this.data = data;
	}

	public static Node initLeftNode(int key, String data, Node node) {
		node.setLeftNode(new Node(key, data));
		return node;
	}

	public static Node initRightNode(int key, String data, Node node) {
		node.setRightNode(new Node(key, data));
		return node;
	}

	public static Node initNode(int key, String data) {
		return new Node(key, data);
	}

	public int getKey() {
		return key;
	}

	public void setKey(int key) {
		this.key = key;
	}

	public Node getLeftNode() {
		return leftNode;
	}

	public void setLeftNode(Node leftNode) {
		this.leftNode = leftNode;
	}

	public Node getRightNode() {
		return rightNode;
	}

	public void setRightNode(Node rightNode) {
		this.rightNode = rightNode;
	}

	public String getData() {
		return data;
	}

	public void setData(String data) {
		this.data = data;
	}

}
